<!DOCTYPE html>
<html>
<head>
    <title>详情展示</title>
    {% include 'admin/common/header.html' %}
</head>
<body>
<form class="layui-form" action="">
    <div class="mainBox">
        <div class="main-container">
         <div id="score_1" style="background-color:#ffffff;min-height:500px;padding: 10px"></div>
        </div>
    </div>

</form>
{% include 'admin/common/footer.html' %}

<script>
layui.use(['layer', 'echarts', 'element', 'count'], function () {
var chartDom = document.getElementById('score_1');
var myChart = echarts.init(chartDom);
var option;

setTimeout(function () {
  option = {
    legend: {},
    tooltip: {
      trigger: 'axis',
      showContent: false
    },
    dataset: {
      source: [
        ['训练科目', '1月', '2月', '3月', '4月', '5月', '6月'],
        ['忧郁', 56.5, 82.1, 88.7, 70.1, 53.4, 85.1],
        ['狭隘', 51.1, 51.4, 55.1, 53.3, 73.8, 68.7],
        ['惊恐', 40.1, 62.2, 69.5, 36.4, 45.2, 32.5],
        ['残暴', 25.2, 37.1, 41.2, 18, 33.9, 49.1],
          ['敏感', 40.1, 62.2, 69.5, 36.4, 45.2, 32.5],
          ['自卑', 40.1, 62.2, 69.5, 36.4, 45.2, 32.5],
      ]
    },
    xAxis: { type: 'category' },
    yAxis: { gridIndex: 0 },
    grid: { top: '55%' },
    series: [
      {
        type: 'line',
        smooth: true,
        seriesLayoutBy: 'row',
        emphasis: { focus: 'series' }
      },
      {
        type: 'line',
        smooth: true,
        seriesLayoutBy: 'row',
        emphasis: { focus: 'series' }
      },
      {
        type: 'line',
        smooth: true,
        seriesLayoutBy: 'row',
        emphasis: { focus: 'series' }
      },
      {
        type: 'line',
        smooth: true,
        seriesLayoutBy: 'row',
        emphasis: { focus: 'series' }
      },
      {
        type: 'pie',
        id: 'pie',
        radius: '30%',
        center: ['50%', '25%'],
        emphasis: {
          focus: 'self'
        },
        label: {
          formatter: '{b}: {@1月} ({d}%)'
        },
        encode: {
          itemName: '训练科目',
          value: '1月',
          tooltip: '1月'
        }
      }
    ]
  };
  myChart.on('updateAxisPointer', function (event) {
    const xAxisInfo = event.axesInfo[0];
    if (xAxisInfo) {
      const dimension = xAxisInfo.value + 1;
      myChart.setOption({
        series: {
          id: 'pie',
          label: {
            formatter: '{b}: {@[' + dimension + ']} ({d}%)'
          },
          encode: {
            value: dimension,
            tooltip: dimension
          }
        }
      });
    }
  });
  myChart.setOption(option);
});

option && myChart.setOption(option);
})

</script>
</body>
</html>